<?php

class ControllerCommonHome extends Controller {

    public function index() {
        $this->document->setTitle($this->config->get('config_title'));
        $this->document->setDescription($this->config->get('config_meta_description'));

        $this->data['heading_title'] = $this->config->get('config_title');

        if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
            $this->template = $this->config->get('config_template') . '/template/common/home.tpl';
        } else {
            $this->template = 'default/template/common/home.tpl';
        } 
        if (($this->request->server['REQUEST_METHOD'] == 'POST') && isset($this->request->post['filter_name'])) {
           $SearchValue = str_replace(' ', '+', $this->request->post['filter_name']);
           $this->redirect(HTTP_SERVER . 'index.php?route=product/search&filter_name=' . $SearchValue);
        }
        $this->children = array(
            'common/column_left',
            'common/column_right',
            'common/column_findgift',
            'common/column_trackorder',
            'common/content_top',
            'common/content_bottom',
            'common/footer',
            'common/header'
        );

        $this->response->setOutput($this->render());
    }

}

?>